<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>KKJSBridge Ajax</title>
<link rel="Stylesheet" type="text/css" href="resource/offlinestyle.css">
<script type="text/javascript" src="resource/offline.js"></script>
<style>
    button {
        background:#000;
        color:#fff;
        padding: 6px 12px;
        font-size: 14px;
        display:block;
        margin-bottom:5px;
        border:none;
        border-radius: 3px;
    }
</style>
</head>
<body>
    <!-- <img src="resource/demo.jpg"> -->
	<a href="/client302">浏览器重定向</a>
	<a href="/client302" target="_blank">_blank 浏览器重定向</a>
    <button onclick="printlog()">printlog</button>
	<button onclick="ajax_get_with_cookie()">ajax_get_with_cookie</button>
	<button onclick="ajax_post_with_cookie()">ajax_post_with_cookie</button>
</body>
<script src="https://cdn.bootcss.com/eruda/1.5.2/eruda.min.js"></script>
<script>eruda.init();</script>
<script type="text/javascript">
	function ajax_get_with_cookie() {
		var xhr = new XMLHttpRequest(),
	     method = "GET",
	     url = "testAjaxGet";
	     xhr.open(method, url, true);
	     xhr.onreadystatechange = function () {
	        if(xhr.readyState === 4 && xhr.status === 200) {
	            console.log(xhr.responseText);
	        }
	     };
	     xhr.send();
	}
	function ajax_post_with_cookie() {
		var xhr = new XMLHttpRequest(),
	     method = "POST",
	     url = "/testAjaxPost";
	     xhr.open(method, url, true);
	     xhr.onreadystatechange = function () {
	        if(xhr.readyState === 4 && xhr.status === 200) {
	            console.log(xhr.responseText);
	        }
	     };
	     xhr.send();
	}
</script>
</html>
